/*
 *  Copyright 2010 UPF Telecos 4th group G.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *  under the License.
 */

package edu.upf.content;

import edu.upf.utils.Definitions;
import java.io.Serializable;

/**
 * Class that respresents a user content and its properties
 * @author netjois
 */
public class DescriptionContent implements Serializable, Definitions {

    private String type,size,popularity,name,owner,path;
    Thumbnail thumbnail;

    /**
     * Constructor of the content descriptor
     * @param type
     * @param size
     * @param pop
     * @param name
     * @param owner
     * @param path
     */
    public DescriptionContent(String type, String size,String pop, String name,
            String owner, String path){
        this.type=type;
        this.size=size;
        this.popularity=pop;
        this.name=name;
        this.owner=owner;
        this.path=path;
        if(type.equals(IMAGE)){
            thumbnail=new Thumbnail(path+name);
        }
    }

    /**
     * Sets the type of the content
     * @param type
     */
    public void setType(String type){
        this.type=type;
    }

    /**
     * Gets the type of the content
     * @return
     */
    public String getType(){
        return type;
    }

    /**
     * Sets an 'informative' size of the content
     * @param size
     */
    public void setSize(String size){
        this.size=size;
    }

    /**
     * Gets and 'informative' size of the content
     * @return
     */
    public String getSize(){
        return size;
    }

    /**
     * Sets the popularity of the content
     * @param popularity
     */
    public void setPopularity(String popularity){
        this.popularity=popularity;
    }

    /**
     * Gets the content popularity
     * @return
     */
    public String getPopularity(){
        return popularity;
    }

    /**
     * Sets the name of the content, usually name plus extension
     * @param name
     */
    public void setName(String name){
        this.name=name;
    }

    /**
     * Gets the name of the content, usually name plus extension
     * @return
     */
    public String getName(){
        return name;
    }

    /**
     * Sets the owner of this content
     * @param owner
     */
    public void setOwner(String owner) {
        this.owner=owner;
    }

    /**
     * Gets the owner of this content
     * @return
     */
    public String getOwner() {
        return owner;
    }

    /**
     * Sets the canonical path of the content
     * @param path
     */
    public void setPath(String path) {
        this.path=path;
    }

    /**
     * Gets the canonical path of the content
     * @return
     */
    public String getPath() {
        return path;
    }

}
